package best.driver.android.View;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import best.driver.android.R;

public class BestAlertDialog extends BestAlertDialogBase {

    public BestAlertDialog(Context context) {
        this(context, null);
    }

    public BestAlertDialog(Context context, BestAlertDialogOnClickListener onClickListener) {
        super(context, R.layout.alert_dialog, onClickListener);
    }

    public void show(String title, String content) {
        setTitle(title);
        setContent(content);
        show();
    }

    private void setContent(String content) {
        TextView tvContent = (TextView)viewContent;
        if (TextUtils.isEmpty(content)) {
            tvContent.setVisibility(View.GONE);
        } else {
            tvContent.setVisibility(View.VISIBLE);
            tvContent.setText(content);
        }
    }
}
